/*
 * Powered By [pkuWx]
 * Web Site: http://www.wuxi.ss.pku.edu.cn
 * Since 2015 - 2015
 */

package cn.edu.pku.wxlib.admintorole.model;

import javax.validation.constraints.*;
import org.hibernate.validator.constraints.*;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import cn.org.rapid_framework.util.DateConvertUtils;

import java.util.*;

import cn.edu.pku.wxlib.admintorole.model.*;
import cn.edu.pku.wxlib.admintorole.service.*;
import cn.edu.pku.wxlib.admintorole.vo.query.*;

import javacommon.base.*;
import javacommon.util.*;
import javacommon.page.Page;

/**
 * @version 1.0
 * @since 1.0
 */


public class Admintorole extends BaseEntity implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;
	
	//alias
	public static final String TABLE_ALIAS = "Admintorole";
	public static final String ALIAS_ADMIN_TO_ROLE_ID = "adminToRoleId";
	public static final String ALIAS_ADMIN_ID = "adminId";
	public static final String ALIAS_ROLE_ID = "roleId";
	public static final String ALIAS_CREATE_TIME = "createTime";
	
	//date formats
	public static final String FORMAT_CREATE_TIME = DATE_FORMAT;
	
	//columns START
    /** adminToRoleId       db_column: adminToRoleId */	
	
	private java.lang.Integer adminToRoleId;
    /** adminId       db_column: adminId */	
	@NotNull 
	private java.lang.Integer adminId;
    /** roleId       db_column: roleId */	
	@NotNull 
	private java.lang.Integer roleId;
    /** createTime       db_column: createTime */	
	
	private java.util.Date createTime;
	//columns END

	public Admintorole(){
	}

	public Admintorole(
		java.lang.Integer adminToRoleId
	){
		this.adminToRoleId = adminToRoleId;
	}

	public void setAdminToRoleId(java.lang.Integer value) {
		this.adminToRoleId = value;
	}
	
	public java.lang.Integer getAdminToRoleId() {
		return this.adminToRoleId;
	}
	public void setAdminId(java.lang.Integer value) {
		this.adminId = value;
	}
	
	public java.lang.Integer getAdminId() {
		return this.adminId;
	}
	public void setRoleId(java.lang.Integer value) {
		this.roleId = value;
	}
	
	public java.lang.Integer getRoleId() {
		return this.roleId;
	}
	public String getCreateTimeString() {
		return DateConvertUtils.format(getCreateTime(), FORMAT_CREATE_TIME);
	}
	public void setCreateTimeString(String value) {
		setCreateTime(DateConvertUtils.parse(value, FORMAT_CREATE_TIME,java.util.Date.class));
	}
	
	public void setCreateTime(java.util.Date value) {
		this.createTime = value;
	}
	
	public java.util.Date getCreateTime() {
		return this.createTime;
	}

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("AdminToRoleId",getAdminToRoleId())
			.append("AdminId",getAdminId())
			.append("RoleId",getRoleId())
			.append("CreateTime",getCreateTime())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getAdminToRoleId())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof Admintorole == false) return false;
		if(this == obj) return true;
		Admintorole other = (Admintorole)obj;
		return new EqualsBuilder()
			.append(getAdminToRoleId(),other.getAdminToRoleId())
			.isEquals();
	}
}

